//
// 304route.cpp for  in /home/goldbe_y//tek3/Projets/Maths/epimaths/304route
// 
// Made by yoni goldberg
// Login   <goldbe_y@epitech.net>
// 
// Started on  Fri Oct 12 14:52:42 2012 yoni goldberg
// Last update Mon Oct 22 11:26:21 2012 yoni goldberg
//

#include "Maths.hpp"

int	main(int ac, char **av)
{
  if (ac == 2)
    {
      Maths	tmp(av[1]);
      int	count = 0;

      std::cout << "Fichier : " << av[1] << std::endl;
      std::cout << "Nombre de taches : " << tmp.getNbTask() << std::endl;
      std::cout << "taches precedentes et durees : " << std::endl;
      for (int i = 0; i < tmp.getNbTask(); i++)
      	{
      	  std::cout << tmp.get_task()[i] << " ";
      	  for (int j = 0; j < tmp.get_p()[i].length(); j++)
      	    std::cout << tmp.get_p()[i].at(j) << " ";
       	  std::cout << tmp.get_time()[i] << std::endl;
      	}
      std::cout << "Dates au plus tot : " << std::endl;
      for (int i = 0; i < tmp.getNbTask(); i++)
      	std::cout << tmp.get_task()[i] << " " << tmp.get_cumul()[i] << std::endl;
      std::cout << "FIN : " << tmp.get_cumul()[tmp.getNbTask()] << std::endl;

      std::cout << "Dates au plus tard et intervalles de flottement : " << std::endl;
      for (int i = 0; i < tmp.getNbTask(); i++)
      	std::cout << (char)(i + 'a') << " : " <<  tmp.get_cumul2()[i] << " " << tmp.get_cumul2()[i] - tmp.get_cumul()[i] << std::endl;

      std::cout << "Chemin critique : " << std::endl;
      std::cout << tmp.get_path() << std::endl;
    }
  else
    std::cout << "Usage : ./305maison file" << std::endl;
  return 0;

}
